package com.sinosoft.bee.services.product.controller;


import com.sinosoft.product.dto.calpremrequest.PremRequestJsonDto;
import com.sinosoft.product.dto.calpremresponse.PremReponseJsonDto;
import com.sinosoft.product.service.CalculatePremService;
import com.sinosoft.product.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 * @author:Frankiegg
 * @date:2018/5/21
 * @project:bee
 * @Modified By:
 **/
@RestController
@RequestMapping(value = "/order/prem")
public class CalculatePrem {

    @Autowired
    private CalculatePremService calculatePremService;

    @GetMapping
    public Result getPrem(@RequestBody @Valid PremRequestJsonDto premRequestJsonDto, BindingResult bindingResult){
        PremReponseJsonDto premReponseJsonDto= calculatePremService.getPrem(premRequestJsonDto);
        Result result = new Result(true,200,premReponseJsonDto);
        return result;
    }
}
